<template>
    <div class="type">
        <good @remove="del" v-for="item in list" :key="item._id" :good="item"></good>
    </div>
</template>

<script>
import good from '@/components/good'
import axios from 'axios'
export default {
  name: '',
  components: {
      good
  },
  data() { 
    return {
        list: []
    }
  },
  created() {
      axios.get('goods.json').then(res => {
        this.list = res.data
      })
  },
  methods:{
    del(id) {
      this.list = this.list.filter(item => item._id !== id)
    }
  },
 }
</script>

<style scoped>
.type {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0 5px;
    justify-content: space-between;
    overflow: auto;
}
</style>